package com.why.dao;

import com.why.pojo.UserAddress;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
@Mapper
public interface UserAddressMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(UserAddress record);

    int insertSelective(UserAddress record);

    UserAddress selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(UserAddress record);

    int updateByPrimaryKey(UserAddress record);

    //根据用户ID查询地址
    List<UserAddress> selectAddressByUserId(Integer userid);

    //修改默认地址
    int updateIsDefault (UserAddress userAddress);

    //重置默认地址
    int updateAllIsDefault(Integer userId);
}